package com.tencent.sr.iris.basic.mp.dependency.activity;

import com.tencent.sr.iris.activity.interfaces.client.activity.ActivityAwardRecordClient;
import com.tencent.sr.iris.activity.interfaces.request.acticity.ActivityGiftPopupRequest;
import com.tencent.sr.iris.activity.interfaces.response.activity.ActivityGiftPopupResponse;
import com.tencent.sr.iris.basic.mp.common.util.HttpUtils;
import com.tencent.sr.rmall.common.primitive.HttpResult;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class ActivityAwardDependency {

    @Resource
    private ActivityAwardRecordClient awardRecordClient;

    /**
     * 活动权益弹窗
     * @param request
     * @return
     */
    public ActivityGiftPopupResponse popup(ActivityGiftPopupRequest request) {
        HttpResult<ActivityGiftPopupResponse> result = awardRecordClient.popup(request);
        return HttpUtils.handleError(result);
    }

    /**
     * 关闭权益弹窗
     * @param request
     * @return
     */
    public Boolean closePopup(ActivityGiftPopupRequest request) {
        HttpResult<Boolean> result = awardRecordClient.closePopup(request);
        return HttpUtils.handleError(result);
    }
}
